<template>
	<view class="top-search-bar">
		<view class="search-text"></view>
		<view class="white-search">
			<image src="/static/search-icon.png" class="search-icon" mode=""></image>
			<input confirm-type="search" v-model="searchValue" @confirm="$emit('onGetSearchData')"/>
		</view>
		<text class="search-text" @click="$emit('onGetSearchData')">搜索</text>
	</view>
</template>

<script setup>
	const searchValue = defineModel('value');
	const emit = defineEmits(['onGetSearchData'])
</script>

<style scoped lang="scss">
	.top-search-bar {
		background-color: #EE8131;
		display: flex;
		justify-content: center;
		align-items: center;
		padding: 26rpx 0;
		margin-bottom: 26rpx;
		.search-text {
			width: 80rpx;
			font-size: 32rpx;
			color: #fff;
			margin: 0 14rpx;
		}
	}

	.white-search {
		width: 540rpx;
		height: 60rpx;
		background-color: #ffffff;
		border-radius: 16rpx;
		display: flex;
		align-items: center;

		.search-icon {
			width: 30rpx;
			height: 30rpx;
			margin: 0 20rpx;
		}

		input {
			height: 56rpx;
			width: 460rpx;
			font-size: 26rpx;
		}
	}
</style>